package com.wondersgroup.fjzlpt.org.dao.impl.jgqy.fwgl;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Repository;

import com.alibaba.fastjson.JSONArray;
import com.quick.framework.boot.repository.sql.bean.SQLBean;
import com.quick.framework.boot.repository.sql.bean.table.TableBean;
import com.quick.framework.boot.repository.sql.jdbcTemplate.impl.BaseJTDAOImpl;
import com.wondersgroup.fjzlpt.org.dao.inter.jgqy.fwgl.FwglYljgDAO;
@Repository
public class FwglYljgDAOImpl extends BaseJTDAOImpl implements FwglYljgDAO{
	@Override
	@Autowired
	@Qualifier("TB_JGQY_FWGL_JSFWJG")
	public void setTb(TableBean tb) {
		super.setTb(tb);
	}

	@Override
	public void delete(Map<String, String> map) {
		StringBuffer sbuf = new StringBuffer();
		sbuf.append("delete from "+this.tb.getTableName()+" where FWGLID = ? ");
		SQLBean sb = new SQLBean(sbuf.toString(), new String[]{map.get("FWGLID")});
		super.update(sb);
	}

	@Override
	public JSONArray query(Map<String, String> map) {
		StringBuffer sbuf = new StringBuffer();
		sbuf.append("select a.*,(select YLJGMC from tb_zd_yljgxx where PTJGID = a.YLJGID) YLJGMC from "+this.tb.getTableName()+" a where a.FWGLID = ? ");
		SQLBean sb = new SQLBean(sbuf.toString(), new String[]{map.get("FWGLID")});
		return super.queryList(sb);
	}

}
